# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2 
# $Header: $

inherit eutils libtool

IUSE=""

DESCRIPTION="Firewire nodes and devices L1394"
HOMEPAGE="http://graphics.cs.uni-sb.de/~repplix/l1394_home/"
SRC_URI="http://graphics.cs.uni-sb.de/~repplix/l1394_home/download/${P}.tar.gz"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86 ~amd64"

DEPEND=">=sys-libs/libraw1394-0.9.0"
	
src_unpack() {
	unpack ${A}
	cd ${S}

	# my own patch to disable examples
	cp configure.in configure.in.orig
	grep -v examples configure.in.orig > configure.in

	cp l1394/Makefile.am l1394/Makefile.am.orig
	sed -e 's@examples@@' l1394/Makefile.am.orig >l1394/Makefile.am

	cp l1394/Makefile.in l1394/Makefile.in.orig
	sed -e 's@examples@@' l1394/Makefile.in.orig >l1394/Makefile.in

	# regeneration makefile and configure from modified configure.in
	elibtoolize

	aclocal || die "aclocal failed"
	autoheader || die "autoheader failed"
	automake -a || die "automake -a failed"
	autoconf || die "autoconf failed"
}
	
src_compile() {
	local myconf="--disable-documentation"
	
	econf ${myconf} || die "Configuration failed."

	emake CFLAGS="${CFLAGS}" || die "Compilation failed."
}

src_install() {

	einstall || die "Installation failed."
}
